package com.happyclub.lcy.dao;

import com.happyclub.pojo.TbTravelUserLike;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

public interface ITravelUserLike extends JpaRepository<TbTravelUserLike,String> {

    //判断用户是否已经点过赞
    TbTravelUserLike findTbTravelUserLikeByTravelIdAndUserId(String travelId, String userId);
    //点赞后再用户点赞表插入数据
    @Modifying
    @Query(value = "insert into TB_TRAVEL_USER_LIKE (TRAVEL_ID, USER_ID,CREATE_TIME) values (?1,?2,?3)",nativeQuery = true)
    int insertTralelUserLike(String travelId, String userId, Date createTime);

}
